#!/usr/bin/env python
# -*- coding: utf-8 -*-

from gettext import gettext as _
	
# reuse the deskbar Keybinder, it changes teh working path however, so 
# restore it after the import

import os
mydir = os.path.normpath(os.path.join(os.path.dirname( __file__),'..'))
print mydir
try:
	from deskbar.core.Keybinder import Keybinder
except:
	Keybinder = None
	print "Global Keybinding will not be available. Install deskbar-applet to use global Keybinding."
os.chdir(mydir)
GLADEFILE = os.path.join(mydir,"agenda","agenda.glade")

try:
	import gtk
	def load_stock_image(name='stock_calendar',size = gtk.ICON_SIZE_SMALL_TOOLBAR ):
		    dir = gtk.TEXT_DIR_NONE
		    state =gtk.STATE_NORMAL
		    try:
		            pixbuf = gtk.icon_theme_get_default().load_icon(name, gtk.icon_size_lookup(size)[0], gtk.ICON_LOOKUP_USE_BUILTIN)
		    except gobject.GError, exc:
		            return gtk.icon_theme_get_default().load_icon(gtk.STOCK_MISSING_IMAGE, gtk.icon_size_lookup(size)[0], gtk.ICON_LOOKUP_USE_BUILTIN)
		    return pixbuf
except:
	pass
